var GameUI = ( function (mod){
    mod.cutscenes = function(){
        game.ccs = game.add.graphics(0, 0);
        game.ccs.beginFill(0xFFFFFF);
        game.ccs.drawRect(0, 0, game.world.width,game.world.height);
        game.ccs.endFill();
        game.add.tween(game.ccs).to({alpha:0},2000,Phaser.Easing.Linear.None,true).onComplete.add(function(){
            game.ccs.kill()
        },this);
    };

    mod.scenesfadeOut = function(speed,yanchi){
        game.ccs = game.add.graphics(0, 0);
        game.ccs.beginFill(0xFFFFFF);
        game.ccs.drawRect(0, 0, game.world.width,game.world.height);
        game.ccs.endFill();
        game.ccs.alpha = 0;
        game.add.tween(game.ccs).to({alpha:1},speed,Phaser.Easing.Linear.None,true,yanchi)
    };

    mod.touch = function(x,y,callback){
        game.touch1 = game.add.sprite(x,y,'touch1');
        game.touch1.anchor.set(0.5);

    

        game.touch2 = game.add.sprite(x,y,'touch2');
        game.touch2.anchor.set(0.5);
        game.touch2.alpha = 0;
        game.touch2.scale.x = 0;
        game.touch2.scale.y = 0;

        game.add.tween(game.touch2).to({alpha:[0,0.9,1,0]},500,Phaser.Easing.Linear.None,true,0,-1)
        game.add.tween(game.touch2.scale).to({x:1.5,y:1.5},500,Phaser.Easing.Linear.None,true,0,-1)

        //game.input.onTap.add(callback, this);

        game.touch1.inputEnabled = true;
        game.touch1.events.onInputDown.add(callback, this);
    }

    return mod;
})(window.GameUI || {});
